%macro make_tinlist;


	data prim;
		set rlib.filing_status;
		person_id = prim_tin;
		keep person_id;
	run;
	data sec;
		set rlib.filing_status(where=(sec_tin>0 & sec_tin~=.));
		person_id = sec_tin;
		keep person_id;
	run;
	data appended;
		set prim sec;
		if person_id ~= .;
	run;

	proc sort data = appended nodupkey;
		by person_id;
	run;
		


		data _null_;
			set appended;
			file "&tmpdir./tinlist" dlm=',';
			put person_id; 
		run;
		
%mend;